# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: tikysal <tikysal@gmail.com>
# Derived from Daniel Ehlers'

pkgname=coin-or-coinutils
pkgver=2.11.10
pkgrel=1
pkgdesc='COIN-OR collection of utility classes'
arch=(loong64 x86_64)
url='https://github.com/coin-or/CoinUtils'
license=(EPL)
depends=(bzip2
         coin-or-data-sample
         glpk
         lapack
         zlib)
makedepends=(doxygen
             gcc-fortran)
groups=(coin-or)
source=($pkgname-$pkgver.tar.gz::https://github.com/coin-or/CoinUtils/archive/refs/tags/releases/$pkgver.tar.gz)
sha256sums=('80c7c215262df8d6bd2ba171617c5df844445871e9891ec6372df12ccbe5bcfd')

build() {
  cd CoinUtils-releases-$pkgver
  ./configure \
    --prefix=/usr \
    --with-blas-lib='-lblas' \
    --with-lapack-lib='-llapack' \
    --with-glpk-lib='-lglpk' \
    --enable-dependency-linking
  make
}

check() {
  cd CoinUtils-releases-$pkgver
  make test
}

package() {
  cd CoinUtils-releases-$pkgver
  make DESTDIR="$pkgdir" install
}
